<%--
  Created by IntelliJ IDEA.
  User: ss
  Date: 2022/1/17
  Time: 10:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>index</title>
</head>
<script src="js/jquery-1.11.1.js" ></script>
<body>
<h1>index ----------${uname}</h1>
<form action="/User/add.do">
    <button>这个是add的get请求</button>
</form>
<form action="/User/update.do " method="post">
    <button>这个是update的post请求</button>
</form>
<form action="/User/hello.do">
    <button>这个是index的请求</button>
</form>
</body>

<button id="bt1" type="button">发送ajax请求</button>
<p1 id="p1"></p1>
</html>
<script>
    $(function (){
        $("#bt1").click(function (){
            $.ajax({
                type:"POST",
                url:"/res/test04",
                data:"",
                success:function (date){
                    alert(date);
                    $("#p1").html( date.tId+date.tName)
                }
            })
        })
    })

</script>
